package pri.zxx.learndemo.designmodels.strategymodel;

import lombok.extern.slf4j.Slf4j;
import pri.zxx.webdemo.utils.GsonUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Twilight
 * @desc
 * @createTime 2020-06-09-21:02
 */
@Slf4j
public class Test {
    public static void main(String[] args) {
        Map<String, Object> data = new HashMap<>();
        data.put("key1", "key1");
        data.put("key2", "key2");
        data.put("key3", "key3");
        data.put("key4", "key4");
        data.put("key5", "key5");

        MsgStrategy sms = StrategyFactory.SMS.create();
        MsgTemplate smsTem = sms.getTemplate("smsappid", "1234", "sms1", data);
        data.put("appId", "wxappid");
        data.put("path", "wxpath");
        MsgStrategy wx = StrategyFactory.WX.create();
        MsgTemplate wxTem = wx.getTemplate("smsappid", "1234", "sms1", data);

        log.warn("sms:\n{}", GsonUtil.gson.toJson(smsTem));
        log.warn("wx:\n{}", GsonUtil.gson.toJson(wxTem));
    }
}
